cmake_minimum_required(VERSION 3.0.2)
project(my_dwa_planner)

find_package(catkin REQUIRED COMPONENTS
  base_local_planner
  costmap_2d
  dynamic_reconfigure
  geometry_msgs
  nav_core
  nav_msgs
  pluginlib
  roscpp
  tf2
  tf2_ros
  tf2_geometry_msgs
)

generate_dynamic_reconfigure_options(
  cfg/DWAPlanner.cfg
)

catkin_package(
  INCLUDE_DIRS include
  LIBRARIES my_dwa_planner
  CATKIN_DEPENDS 
    base_local_planner 
    costmap_2d 
    dynamic_reconfigure 
    geometry_msgs 
    nav_core 
    nav_msgs 
    pluginlib 
    roscpp 
    tf2 
    tf2_ros
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${Eigen_INCLUDE_DIRS}
)

add_library(my_dwa_planner src/dwa_planner.cpp)
target_link_libraries(my_dwa_planner ${catkin_LIBRARIES})

install(TARGETS my_dwa_planner
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
)

install(FILES my_dwa_planner_plugin.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)